package com.hust.util;

import com.hust.intercetor.UserIntercetor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.ArrayList;
import java.util.List;


@Configuration
public class IntercetorConfiguration implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        List list = new ArrayList();
        list.add("/login");
        list.add("/register");
        list.add("/loginverify");
        list.add("/userregister");
        list.add("/static/**");
        registry.addInterceptor(new UserIntercetor()).addPathPatterns("/**").excludePathPatterns(list);
    }
}
